<?php
/**
* 地址接口参数
*/
class openapi_api_params_v1_delivery extends openapi_api_params_abstract implements openapi_api_params_interface{
	
    public function checkParams($method,$params,&$sub_msg,$defined_params=array(),$dataType='kv'){
        if(parent::checkParams($method,$params,$sub_msg,$defined_params,$dataType)){
            return true;
        }else{
            return false;
        }
    }

    public function getAppParams($method){
        $params = array(
            'add'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'name'=>array('required'=>'true','type'=>'string','name'=>'收货人姓名'),
                'area'=>array('required'=>'true','type'=>'string','name'=>'收货人区域'),
                'addr'=>array('required'=>'true','type'=>'string','name'=>'收货人地址'),
                'mobile'=>array('required'=>'true','type'=>'int','name'=>'手机号'),
                'telephone'=>array('required'=>'true','type'=>'string','name'=>'电话'),
                'zipcode'=>array('required'=>'true','type'=>'int','name'=>'邮编'),
            ),
            'getlist'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
            ),
            'detail'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'addr_id'=>array('required'=>'true','type'=>'int','name'=>'地址id'),
            ),
            'modify'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'addr_id'=>array('required'=>'true','type'=>'int','name'=>'地址id'),
                'default'=>array('required'=>'true','type'=>'int','name'=>'是否设为默认地址'),
                'name'=>array('required'=>'true','type'=>'string','name'=>'收货人姓名'),
                'area'=>array('required'=>'true','type'=>'string','name'=>'收货人区域'),
                'addr'=>array('required'=>'true','type'=>'string','name'=>'收货人地址'),
                'mobile'=>array('required'=>'true','type'=>'int','name'=>'手机号'),
                'telephone'=>array('required'=>'true','type'=>'string','name'=>'电话'),
                'zipcode'=>array('required'=>'true','type'=>'int','name'=>'邮编'),
            ),
            'delete'=>array(
                'login_token'=>array('required'=>'true','type'=>'string','name'=>'登录token'),
                'addr_id'=>array('required'=>'true','type'=>'int','name'=>'地址id'),
            ),
        );

        return $params[$method];
    }

    public function description($method){
        $description = array(
            'add'=>array(
                'name'        =>'新增收货地址',
                'description' =>'新增收货地址接口',
            ),
            'getlist'=>array(
                'name'        =>'获取收货地址列表',
                'description' =>'获取收货地址列表接口',
            ),
            'detail'=>array(
                'name'        =>'查询收货地址详情',
                'description' =>'查询收货地址详情',
            ),
            'modify'=>array(
                'name'        =>'修改收货地址',
                'description' =>'修改收货地址接口',
            ),
            'delete'=>array(
                'name'        =>'删除收货地址',
                'description' =>'删除收货地址接口',
            ),
        );
        return $description[$method];
    }

}